


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > FizzBuzz</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">&lt;empty package name&gt;</a>
</div>

<h1>Coverage Summary for Class: FizzBuzz (&lt;empty package name&gt;)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Branch, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">FizzBuzz</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/8)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/8)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/16)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;public class FizzBuzz {
&nbsp;    private int number; // 数字字段
&nbsp;    private String result; // 结果字段
&nbsp;
&nbsp;    // 无参构造方法
<b class="nc">&nbsp;    public FizzBuzz() {</b>
&nbsp;    }
&nbsp;
&nbsp;    // 带参构造方法
<b class="nc">&nbsp;    public FizzBuzz(int number, String result) {</b>
<b class="nc">&nbsp;        this.number = number;</b>
<b class="nc">&nbsp;        this.result = result;</b>
&nbsp;    }
&nbsp;
&nbsp;    // Getter 和 Setter 方法
&nbsp;    public int getNumber() {
<b class="nc">&nbsp;        return number;</b>
&nbsp;    }
&nbsp;
&nbsp;    public void setNumber(int number) {
<b class="nc">&nbsp;        this.number = number;</b>
&nbsp;    }
&nbsp;
&nbsp;    public String getResult() {
<b class="nc">&nbsp;        return result;</b>
&nbsp;    }
&nbsp;
&nbsp;    public void setResult(String result) {
<b class="nc">&nbsp;        this.result = result;</b>
&nbsp;    }
&nbsp;
&nbsp;    // toString 方法，便于打印对象信息
&nbsp;    @Override
&nbsp;    public String toString() {
<b class="nc">&nbsp;        return &quot;FizzBuzz{&quot; +</b>
&nbsp;                &quot;number=&quot; + number +
&nbsp;                &quot;, result=&#39;&quot; + result + &#39;\&#39;&#39; +
&nbsp;                &#39;}&#39;;
&nbsp;    }
&nbsp;
&nbsp;    // 添加 fizzBuzz 静态方法
&nbsp;    public static String fizzBuzz(int number) {
<b class="nc">&nbsp;        if (number % 3 == 0 &amp;&amp; number % 5 == 0) {</b>
<b class="nc">&nbsp;            return &quot;FizzBuzz&quot;;</b>
<b class="nc">&nbsp;        } else if (number % 3 == 0) {</b>
<b class="nc">&nbsp;            return &quot;Fizz&quot;;</b>
<b class="nc">&nbsp;        } else if (number % 5 == 0) {</b>
<b class="nc">&nbsp;            return &quot;Buzz&quot;;</b>
&nbsp;        } else {
<b class="nc">&nbsp;            return String.valueOf(number);</b>
&nbsp;        }
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2025-04-29 20:39</div>
</div>
</body>
</html>
